package com.wb.service.impl;


import com.github.pagehelper.PageHelper;
import com.wb.mapper.EbUserMapper;
import com.wb.model.EbUser;
import com.wb.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private EbUserMapper ebUserMapper;

    @Override
    public List<EbUser> list(int page, int pageSize) {
        PageHelper.startPage(page,pageSize);
        List<EbUser> ebUsers = ebUserMapper.selectByExample(null);
        return ebUsers;
    }

    @Override
    public Integer save(EbUser ebUser) {

        return ebUserMapper.insertSelective(ebUser);
    }

    @Override
    public EbUser selectOne(String euUserId) {
        return ebUserMapper.selectByPrimaryKey(euUserId);
    }


    @Override
    public int deletUser(String euUserId) {
        return ebUserMapper.deleteByPrimaryKey(euUserId);
    }

    @Override
    public Integer updateUser(EbUser ebUser) {
        return ebUserMapper.updateByPrimaryKey(ebUser);
    }


}

